import { defineComponent, computed } from 'vue'
import { useRoute } from 'vue-router'

const PageTitle = defineComponent({
  setup () {
    const route = useRoute()
    const pageName = computed(() => {
      return route.matched[route.matched.length - 1].name
    })
    return () => (
      <div style={{ fontSize: '18px', fontWeight: 'bold', marginBottom: '18px' }}>{pageName.value}</div>
    )
  }
})

export default PageTitle
